# Maintainer: David Runge <dvzrv@archlinux.org>

pkgname=qmidictl
pkgver=0.9.11
pkgrel=1
pkgdesc="MIDI remote control application sending MIDI data over network using UDP/IP multicast"
arch=(loong64 x86_64)
url="https://qmidictl.sourceforge.io/"
license=(GPL-2.0-or-later)
groups=(pro-audio)
depends=(
  gcc-libs
  glibc
  hicolor-icon-theme
  qt6-base
  qt6-svg
)
makedepends=(
  cmake
  qt6-tools
)
optdepends=(
  'qt6-wayland: for native wayland support'
)
source=(https://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz)
sha512sums=('ba93e09eef1a83b5b9845339e82120f1d6ff710c8e2771a3b822e89ce68bbc36df0a24fbb9aefc25ab8138be6f20a96777ca6ec8509efe2a126a7f697b063531')
b2sums=('d174b1f0786c00db5d7630107d11ede8005befcf15c19c67f124df60fb3cc4afff81d1ffada289f02e4236d0d65ff7a920054b5ed0696a3f33d5c71f7dd8be62')

build() {
  local cmake_options=(
    -B build
    -D CMAKE_BUILD_TYPE=None
    -D CMAKE_INSTALL_PREFIX=/usr
    -D CONFIG_QT6=ON
    -S $pkgname-$pkgver
    -W no-dev
  )

  cmake "${cmake_options[@]}"
  cmake --build build --verbose
}

package() {
  DESTDIR="$pkgdir" cmake --install build
  install -vDm 644 $pkgname-$pkgver/{ChangeLog,README} -t "$pkgdir/usr/share/doc/$pkgname/"
}
